﻿<navigation:Page  x:Class="SomethingSpacial.Views.Admin.SponsorList" 
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
            xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
            xmlns:activity="clr-namespace:System.Windows.Controls;assembly=ActivityControl"
            xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"  
            xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit" 
            xmlns:vm="clr-namespace:SomethingSpacial.ViewModel"
            Title="SponsorList Page">
            <navigation:Page.DataContext>
                <vm:SponsorsViewModel x:Name="vmSponsors"  />
            </navigation:Page.DataContext>

            <StackPanel x:Name="LayoutRoot" Margin="0"  Height="479"  Style="{StaticResource ContentStackPanelStyle}" >

                <!-- Page Content -->
                <StackPanel x:Name="stackPanelContent"  Orientation="Horizontal">

					<!-- Listing Panel-->
					<Border x:Name="borderList" HorizontalAlignment="Left" Margin="0,0,10,10" VerticalAlignment="Top" CornerRadius="10" BorderThickness="1" BorderBrush="Black" Padding="10" Background="#FFFAFAFA" Width="500">
	            		<StackPanel x:Name="stackPanelList" Orientation="Vertical" VerticalAlignment="Top" Background="White" Margin="0" d:LayoutOverrides="Width" Height="450" HorizontalAlignment="Left">
            			    <TextBlock x:Name="textBlockListingHeader" Text="Sponsor Listing" TextWrapping="Wrap" FontWeight="Bold" FontSize="13.333" Foreground="#FF1D1472" HorizontalAlignment="Left"/>
                 
                            <activity:Activity x:Name="activityContent" IsActive="{Binding IsBusy, ElementName=dds}" VerticalAlignment="Top" HorizontalAlignment="Left">
            				    <data:DataGrid x:Name="gridSponsors" Height="378" Width="450" IsReadOnly="True" AutoGenerateColumns="False" HorizontalAlignment="Left" 
            					    HorizontalScrollBarVisibility="Disabled"   VerticalAlignment="Top"                                                   
            					    ItemsSource="{Binding Sponsors}" Margin="0"  >
            					    <data:DataGrid.Columns>
            						    <data:DataGridTextColumn Header="ID"  Binding="{Binding SPN_Id, Mode=TwoWay}" Width="50"  />
            						    <data:DataGridTextColumn Header="Sponsor Name" Binding="{Binding SPN_Name, Mode=TwoWay}" Width="100" />
            						    <data:DataGridTextColumn Header="Sponsor URL" Binding="{Binding SPN_URL, Mode=TwoWay}" Width="200" />
            					    </data:DataGrid.Columns>
            				    </data:DataGrid>
            			    </activity:Activity>

                			<StackPanel x:Name="stackPanelActionButtons" Orientation="Horizontal" VerticalAlignment="Bottom" Grid.Row="2" d:LayoutOverrides="Width" Margin="0,0,0,1" Height="39">
                				<Button x:Name="buttonAddNew" Content="Add New" Width="105" Height="28" 	Margin="5,0,0,0" HorizontalAlignment="Left" Click="AddNew_Click" />
                				<Button x:Name="buttonSubmit" Content="Update" Width="105" Height="28" Click="SubmitButton_Click"	/>
                				<Button x:Name="buttonDelete" Content="Delete" Width="105" Height="28"	Margin="5,6,0,5"	/>
                			</StackPanel>
                		</StackPanel>

                	</Border>

            	    <!-- Details StackPanel-->
            	    <Border x:Name="borderDetails" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Top" Width="500" d:LayoutOverrides="GridBox" CornerRadius="10" BorderThickness="1" BorderBrush="Black" Padding="10" Background="#FFFAFAFA">
            		    <StackPanel x:Name="stackPanelDetails" Orientation="Vertical" VerticalAlignment="Top" Height="450" Width="450" HorizontalAlignment="Left">
            			    <TextBlock x:Name="textBlockHeaderDetails" FontSize="13.333" FontWeight="Bold" Foreground="#FF1D1472" Text="Sponsor Details" TextWrapping="Wrap" Margin="0,0,40,0" d:LayoutOverrides="Width" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                    		    <dataControls:DataForm x:Name="editDataForm" Height="378" Width="450" 	VerticalAlignment="Top"  Header=""
                    			    CurrentItem="{Binding SelectedItem, ElementName=gridSponsors}" d:LayoutOverrides="GridBox" HorizontalAlignment="Left" Margin="0" HeaderVisibility="Collapsed" >
                    			    <dataControls:DataForm.EditTemplate>
                    				    <DataTemplate>
                    					    <StackPanel>
                    						    <dataControls:DataField Label="Sponsor Name:" >
                    							    <TextBox Text="{Binding SPN_Name, Mode=TwoWay}"  Width="200" HorizontalAlignment="Left" />
                    						    </dataControls:DataField>
                                                <dataControls:DataField Label="Description:">
                                                    <TextBox Text="{Binding  SPN_Description, Mode=TwoWay}" Width="280" Height="120" HorizontalAlignment="Left"  TextWrapping="Wrap" />
                                                </dataControls:DataField>
                                                <dataControls:DataField Label="Sponsor URL:">
                                                    <TextBox Text="{Binding SPN_URL, Mode=TwoWay}" HorizontalAlignment="Left" Width="200"  />
                                                </dataControls:DataField>
                                                <dataControls:DataField Label="Logo Filename:">
                                                    <TextBox Text="{Binding SPN_LogoFilename, Mode=TwoWay}" HorizontalAlignment="Left" Width="200"  />
                                                </dataControls:DataField>
                                                <dataControls:DataField Label="IsActive">
                                                    <TextBox Text="{Binding SPN_IsActive, Mode=TwoWay}" HorizontalAlignment="Left"  />
                                                </dataControls:DataField>
                                            </StackPanel>
                    				    </DataTemplate>
                    			    </dataControls:DataForm.EditTemplate>


                    		    </dataControls:DataForm>
                    	    </StackPanel>

                        </Border>

                </StackPanel>           
        
        </StackPanel>
        
</navigation:Page>
